Get Attribute Type

Does their exist any function to get attribute type.I am not asking about base type as I know I can get it using "type(module m,string attrname)"
I am asking about the Type of attribute.
e.g:
when I use
void createAttributes(Module srcMod,Module tgtMod,string[] attrList)
{
string aType=""
string attr=""
for attr in attrList do
{
aType=type(srcMod,attr)
create object type aType attribute attr
}
}
All attributes are copied successfully but problem comes for boolean attribuute .I have a boolean type attribute named "IsRequirement".
"Enumeration" is returned to aType for this attribute and error occurs in next line where aType is used.

Please tell me how can I get Attribute type
MF2G_qaus_qazah - Wed Apr 25 06:17:55 EDT 2012

Re: Get Attribute Type
PDU - Wed Apr 25 07:21:29 EDT 2012

Hi,

in the Help for Dxl, you have en example (section Attribute types) :
 

// name 
AttrType at = find(current Module, "Created Thru") 
print at.name           // prints  "Created Thru" 
// type 
AttrType at = find(current Module, "Integer") 
print stringOf at.type 
print at.type "\n" 
// test for a minimum value 
AttrType at = find(current Module, "Type with Min Int value") 
if (at.minValue) {
    // Enter here if type has a minimum value.
    // The following is valid only if base type
    // is integer.
    // The operator is also defined for real and
    // date 
    int i = at.minValue
} 
// strings 
AttrType t 
t=find(current Module, "TableType") 
print t.strings[1] 
// size 
AttrType at = find(current Module, "Boolean") 
print at.size            // prints "2" 
// names 
AttrType at = find(current Module, "Boolean") 
print at.strings[0] 
print at.strings[1] 
// values 
AttrType at = find(current,"Boolean") 
print at.values[0] 
print at.values[1] 
// colors 
AttrType at = find(current,"Boolean") 
print at.colours[0] 
print at.colors[1] 
// canWrite and system 
AttrType at 
Module m = current 
for at in m do{
    print at.name "- system: " at.system"; can
          write: " at.canWrite "\n"
}

 


Pierre